{if !$open}
	<div id="overlay">
		<div class="ui-overlay">
			<div class="ui-widget-overlay" style="z-index: 5; position: fixed; width: 100%; height: 100%;">
			</div>
		</div>
		<div class="ui-widget-content ui-corner-all" style="z-index: 10; padding: 8px; position: absolute; top: 20%; left: 50%; margin-left: -450px; width: 920px;">
			<div style=" width: 600px; float: left;">
				<h3 style="margin-top: 0; color: #DD4B39;">Návod</h3>
				{include file="`$smarty.const.TEMPLATE_DIR`snippets/tut_miesta_more.tpl"}
			</div>
			<div style="margin-top: 50px; padding: 8px; width: 300px; float: right;" class="ui-widget ui-widget-content ui-corner-all">
				<h3 class="ui-widget-header" style="margin-top: 0; text-align: center;"> 
					Spustenie rezervácie
				</h3>
				<h2 style="text-align: center;">
					<span id="days">
						xx
					</span>
					:
					<span id="hours">
						xx
					</span>
					:
					<span id="minutes">
						xx
					</span>
					:
					<span id="seconds">
						xx
					</span> 
				</h2>
				<div class="ui-state-highlight">
					<span class="ui-icon ui-icon-info" style="float: left;">&nbsp;</span>
					<span style="margin-left: 17px; display: block;">
						Po spustení rezervácie sa Vám stránka aktualizuje automaticky.
					</span>	
				</div>
				<a href="home" style="float: right; padding-right: 10px;"> Hlavná stránka </a>
			</div>
		</div>
		
	</div>
	
	<script type="text/javascript">
		var START_TIME = {$smarty.const.START_TIME};
        var END_TIME = {$smarty.const.END_TIME};
        var interval = setInterval(renderTimer, 1000);
		renderTimer();
		function renderTimer(){
            var timestamp = Math.round(+new Date() / 1000);
            if (timestamp > END_TIME){
                return;
            }
            var difference = START_TIME - timestamp;
			if(difference <= 0){
				clearInterval(interval);
				$("#overlay").hide();
			}
			var days = Math.floor(difference / (3600 * 24));
			difference %= (3600 * 24);
			var hours = Math.floor(difference / 3600);
			if (hours < 10){
				hours = "0" + hours;
			}
			difference %= 3600;
			var minutes = Math.floor(difference / 60);
			if (minutes < 10){
				minutes = "0" + minutes;
			}
			difference %= 60;
			var seconds = difference;
			if (seconds < 10){
				seconds = "0" + seconds;
			}
			$("#days").html(days);
			$("#hours").html(hours);
			$("#minutes").html(minutes);
			$("#seconds").html(seconds);
		}		
	</script>	
{/if}